//
//  CheckNetwork.h
//  CheckNetworkTest
//
//  Created by shudan on 12/20/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <UIKit/UIAlertView.h>

#define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification"
#define isStartCheckNet  1 //(1:YES 0:NO)
#define CHECKNETALERT	100
@class QuoteModel;

typedef enum {
	noUsableNetwork = 0,
	usableNetworkViaWiFi,
	usableNetworkViaWWAN
} PANetworkStatus;

@interface CheckNetwork : NSObject <UIAlertViewDelegate> {
	BOOL localWiFiRef;//
	SCNetworkReachabilityRef reachabilityRef;//
}

+(CheckNetwork*)shareCheckNetwork;
-(id)init;
-(int)getNetType;
@property (assign) BOOL localWiFiRef;
@property (assign) SCNetworkReachabilityRef reachabilityRef;

-(int)checkNetworkTypeToURL;//检测当前网络状态,供其它类使用
-(void)startThread;
-(void)startTheBackgroundJob; 
- (PANetworkStatus) currentReachabilityStatus;//获得当前可得到的网络状态，供本类使用
- (PANetworkStatus) localWiFiStatusForFlags: (SCNetworkReachabilityFlags) flags;//
- (PANetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags;//

//Start listening for reachability notifications on the current run loop
- (BOOL) startNotifier;
- (void) stopNotifier;
- (void) getUUID;
@end
